package com.jht.bletool2java.activity;

import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;

import androidx.appcompat.app.AppCompatActivity;

import com.jht.bletool2java.BuildConfig;


public abstract class BaseActivity extends AppCompatActivity {
    private static final String TAG = "BaseActivity";

    public static boolean DEBUG = BuildConfig.DEBUG;

    public abstract int getLayoutID();

    public abstract void initViewAndPresenter();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setStatus();
        setContentView(getLayoutID());

        initViewAndPresenter();
    }

    protected void setStatus() {
        if(DEBUG){
            Log.d(TAG, "setStatus: ");
        }
        Window window = getWindow();
        window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
        window.setStatusBarColor(Color.TRANSPARENT);
    }




}